home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 025a / gsdb25.zip / DB_XPL18.PAS < prev    next >
Pascal/Delphi Source File  |  1991-08-01  |  2KB  |  70 lines

  1. program DB_Xpl18;
  2. uses
  3.    CRT,
  4.    DOS,
  5.    GS_Winfc,
  6.    GS_dBFld,
  7.    GS_dBase;
  8.  
  9. type
  10.    Talk_Obj  = object(GS_dBFld_Objt)
  11.                   constructor Init(FName : string);
  12.                   procedure   StatusUpdate(statword1,statword2,
  13.                                             statword3 : longint); virtual;
  14.                end;
  15.  
  16. var
  17.    Health  : Talk_Obj;
  18.    TalkWin   : GS_Wind_Objt;
  19.  
  20.  
  21. constructor Talk_Obj.Init(FName : string);
  22. begin
  23.    GS_dBFld_Objt.Init(FName);
  24.    TalkWin.InitWin(10,10,70,15,Blue,LightGray,Yellow,LightGray,Black,true,
  25.                   '',true);
  26. end;
  27.  
  28. procedure Talk_Obj.StatusUpdate(statword1,statword2,statword3 : longint);
  29. begin
  30.    case statword1 of
  31.       StatusStart   : begin
  32.                          case statword2 of
  33.                             StatusPack  : TalkWin.NamWin('[ Pack Progress ]');
  34.                             StatusIndexTo : TalkWin.NamWin
  35.                                                     ('[ Index Progress ]');
  36.                          end;
  37.                          TalkWin.SetWin;
  38.                          GotoXY(26,3);
  39.                          write('Total Records to Process = ',statword3);
  40.                       end;
  41.       StatusStop    : begin
  42.                          TalkWin.RelWin;
  43.                       end;
  44.       StatusPack,
  45.       StatusIndexTo : begin
  46.                          GoToXy(2,3);
  47.                          write('Record Number ',statword2,'  ');
  48.                       end;
  49.    end;
  50. end;
  51.  
  52. begin
  53.    ClrScr;
  54.    Health.Init('HEALTH');
  55.    Health.Open;
  56.    Health.IndexTo('FOODCODE','FOOD_CODE');
  57.                                     {Create an index.  Use field FOOD_CODE}
  58.                                     {and create a .NDX file named FOODCODE}
  59.    Health.Index('FOODCODE');        {Use Index FOODCODE.NDX}
  60.    Health.GetRec(Top_Record);
  61.    while not Health.File_EOF do
  62.    begin
  63.       writeln(Health.FieldGet('FOOD'),'   ',
  64.               Health.FieldGet('CALS'),'   (',
  65.               Health.FieldGet('FOOD_CODE'),')');
  66.       Health.GetRec(Next_Record);
  67.    end;
  68.    Health.Close;
  69. end.
  70.